package router

import (
	v1 "base-web/api/v1"
	"base-web/middleware"
	"github.com/gin-gonic/gin"
)

func InitUserRouter(Router *gin.RouterGroup) {
	//聚合数据接口
	JuHeRputer := Router.Group("juhe")
	{
		JuHeRputer.GET("joke", v1.Joke)
		JuHeRputer.GET("toutiao", v1.Toutiao)
		JuHeRputer.GET("weather", v1.Weather)
		JuHeRputer.GET("japi", v1.Japi)
		JuHeRputer.GET("mobile", v1.Mobile)
	}

	Router.POST("user/user-login", v1.UserLogin)

	//需要身份验证加上`.Use(middleware.JwtAuth())`
	userRouter := Router.Group("user").Use(middleware.JwtAuth())
	{
		userRouter.GET("get-user-list", v1.GetUserList)
		userRouter.GET("add-user", v1.AddUser)
		userRouter.POST("upload", v1.Upload)
	}
}
